package cn.wanho.service.impl;

import cn.wanho.dao.CmsClassStudentMapper;
import cn.wanho.dto.CmsClassStudent;
import cn.wanho.rvo.ResultEnum;
import cn.wanho.rvo.ResultVO;
import cn.wanho.service.CmsClassStudentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.xml.transform.Result;

@Service
public class CmsClassStudentServiceImpl implements CmsClassStudentService {
    @Resource
    private CmsClassStudentMapper cmsClassStudentMapper;

    /**
     * 学生班级绑定表
     * @param cmsClassStudent
     * @return
     */
    @Override
    public ResultVO setStudentClass(CmsClassStudent cmsClassStudent) {
        int i = cmsClassStudentMapper.insert(cmsClassStudent);
        if (i>0) {
            return ResultVO.success(ResultEnum.STUDENT_CLASS_SUCCESS.getResCode(), ResultEnum.STUDENT_CLASS_SUCCESS.getResMsg());
        }else{
            return ResultVO.failure(ResultEnum.STUDENT_CLASS_FAILURE.getResCode(), ResultEnum.STUDENT_CLASS_FAILURE.getResMsg());
        }
    }
}
